package com.petshop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.petshop.dto.LoginDTO;
import com.petshop.dto.PasswordClass;
import com.petshop.pojo.Users;
import com.petshop.utils.Result;
import jakarta.servlet.http.HttpSession;

import java.math.BigDecimal;

/**
 * @author 20289
 * @description 针对表【users(存储用户基本信息)】的数据库操作Service
 * @createDate 2025-02-27 11:17:00
 */
public interface UsersService extends IService<Users> {

    /*
    登录业务实现
     */
    Result login(Users users);

    Users getUserInfo(String token);

    Result checkUsername(String username);

    Result regist(Users user);

    /**
     * 修改用户信息
     *
     * @param user
     * @return
     */
    Result updateUserInfo(Users user);


    /**
     * 充值
     *
     * @param amount
     * @param token
     * @return
     */
    Result recharge(BigDecimal amount, String token);

    /**
     * 改密码
     *
     * @param passwordClass
     * @param token
     * @return
     */
    Result updatePassword(PasswordClass passwordClass, String token);

    /**
     * 手机号登录
     *
     * @param loginDTO
     * @param session
     * @return
     */
    Result login1(LoginDTO loginDTO, HttpSession session);

    /**
     * 生成手机验证码
     *
     * @param phone
     * @param session
     * @return
     */
    Result sendCode(String phone, HttpSession session);

    /**
     * 实现签到
     * @return
     */
    Result sign();

    /**
     * 统计截止当前天数的连续签到天数
     * @return
     */
    Result signCount();
}
